//index.js
//获取应用实例
const app = getApp()
let api = require('../../utils/util.js');
let resultData = require('../../utils/data.js');
console.log(resultData.subJectData,"xx");
Page({
  data: {
    bannerData: [],
    subJectData:[]
  },
  onLoad: function() {
    this.setData({
      bannerData: resultData.bannerData,
      subJectData: resultData.subJectData
    })
    // this.getBannerData();
  },
  getBannerData: function() {
    api.getData('/onebox/movie/pmovie', 'get', {
      key: 'a8b932b7661aee98fcb3c89984626302',
      city: '广州'
    }).then(res => {
      console.log(res)
    }, e => {
      console.log(e)
    });

  },
  imgLoad: function(e) {
    console.log(e.detail)
    var winWidth = wx.getSystemInfoSync().windowWidth; //获取屏幕宽度
    var imgWidth = e.detail.width; //图片宽度
    var imgHeight = e.detail.height; //图片高度
    this.setData({
      swiperHeight: winWidth * imgHeight / imgWidth + 'px'
    })
  }
})